/**
 * 
 */
package gui.text;


import javax.swing.JTextPane;
import javax.swing.event.CaretEvent;
import javax.swing.text.StyledDocument;

/**
 * The root element for the hierarchy of JTextPanes used to represent math elements.
 * 
 * Since it is expected that this element will have other JTextPane derived components within it, the arrow
 * keys transfer focus to child Components upon reaching their positions in the text.
 * 
 * @author Joshua Lockerman
 * 
 */
public class RootPane extends JTextPane {
    
    /**
     * 
     */
    public RootPane()
    {
        super();
        addListeners();
    }
    
    private void addListeners()
    {
        addKeyListener(new FocusDownKeyListener(this));
    }
    
    /**
     * @param doc
     */
    public RootPane(StyledDocument doc)
    {
        super(doc);
        addListeners();
    }
    
    public void caretUpdate(CaretEvent e)
    {
        if(e.getSource() == this) {
            // TODO
        }
    }
    
}
